﻿using EWC.Core.Application.Dtos;
using MediatR;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;
using EWC.HIS.Domain.ViewManage.Do;
using EWC.HIS.Application.Contracts.ViewService.Queries;

namespace EWC.HIS.WebApi.Controllers
{
    /// <summary>
    /// 科室相关信息
    /// </summary>
    [ApiController]
    [Route("[controller]")]
    public class DepartmentController : ControllerBase
    {

        private readonly IMediator _mediator;

        public DepartmentController(IMediator mediator)
        {
            _mediator = mediator;
        }


        /// <summary>
        /// 获取科室相关信息
        /// </summary>
        /// <returns>科室相关信息列表</returns>
        [HttpGet]
        public async Task<ActionResult<IEnumerable<DepartmentDo>>> GetList()
        {
            var query = new GetDepartmentsQuery(new PagedRequestInput());
            var list = await _mediator.Send(query);
            return Ok(list);
        }

       
    }
}
